﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;

namespace DB.DataHelper
{
    public interface ISqlDataHelperService
    {
        /// <summary>
        /// SQL数据库 连接字符串
        /// </summary>
        string SqlServiceConnectionString { set; }
        /// <summary>
        /// 设置 SQL数据库 连接字符串
        /// </summary>
        /// <param name="dataSource">服务器名称</param>
        /// <param name="initialCatalog">数据库名称</param>
        /// <param name="isVerification"> true windows验证 不需要用户名和密码 false sql service 验证 需要用户名密码</param>
        /// <param name="user">用户名</param>
        /// <param name="password">登录密码</param>
        /// <returns></returns>
        void SetSqlServiceConnectionString(string dataSource, string initialCatalog, bool isVerification, string user, string password);

        /// <summary>
        /// 执行sql 返回dataTable
        /// </summary>
        /// <param name="assql"></param>
        /// <returns></returns>
        DataTable GetDataTable(string assql);
        /// <summary>
        /// 执行select语句的查询方法，有参数 返回dataTable
        /// </summary>
        /// <param name="strsql"></param>
        /// <param name="sqlParameter"></param>
        /// <returns></returns>
        DataTable GetDataTable(string strsql, SqlParameter[] sqlParameter);
        /// <summary>
        /// 执行sql（增加 删 等）
        /// </summary>
        /// <param name="assql"></param>
        void ExecuteSql(string assql);
        void ExecuteSql(string assql, SqlParameter[] sqlParameter);

    }
}
